/**
 * Created by xiexb on 2017/7/19.
 */
//dojo.require("plugin/EchartsLayer");
dynamicLoading.js("/script/plugins/echarts/echarts.source.js");
//dynamicLoading.js("/script/plugins/echarts/echarts.js");

function EchartsDemo() {
    /**
     * 初始化
     */
    this.init = function () {
        gis_core.addPlugin(this);
        //加载库文件
        //gis_core.addExtentChange("hotCell_extentchange", extentchange);
        require(["plugin/EchartsLayer", "dojo/domReady!"], function (EchartsLayer) {

            var overlay = new EchartsLayer(gis_core.map, echarts);
            var chartsContainer = overlay.getEchartsContainer();
            var myChart = overlay.initECharts(chartsContainer);
            window.onresize = myChart.onresize;

            /*var option = {
             title : {
             text: '百度迁徙图ArcGIS JS API版',
             subtext: '-- Develop By WanderGIS',
             x:'center',
             y:'top',
             textStyle: {
             color: '#FFC107'
             }
             },
             legend: {
             show: true,
             x: 'right',
             orient: 'vertical',
             textStyle: {
             color: 'red'
             },
             data: []
             },
             series : [{
             name: "订单流向",
             type: 'map',
             mapType: 'none',
             itemStyle: {
             normal: {
             borderColor:'rgba(100,149,237,0.2)',
             borderWidth:0.5,
             areaStyle: {
             color: '#1b1b1b'
             }
             }
             },
             data: [{}],
             hoverable: false,
             clickable: false,
             roam: true,
             markLine: {
             effect: {
             color: 'rgba(204, 246, 255, 0.09)',
             show: true,
             period: 40
             },
             bundling: {
             enable: true
             },
             large: true,
             smooth: true,
             smoothness: 0.1,
             symbol: ['none', 'none'],
             itemStyle: {
             normal: {
             lineStyle: {
             color: 'rgba(2, 166, 253, 0.05)',
             type: 'solid',
             width: 0.5,
             opacity: 0.2
             }
             }
             },
             data: []
             },
             markPoint: {
             symbol: 'circle',
             symbolSize: 1.5,
             itemStyle: {
             normal: {
             color: 'rgba(255, 0, 0, 0.5)'
             }
             },
             data: []
             }
             }]
             };
             var geoCoord = {"北京":[116.395645,39.929986],"上海":[121.487899,31.249162],"天津":[117.210813,39.14393],"重庆":[106.530635,29.544606],"安徽":[117.216005,31.859252],"合肥":[117.282699,31.866942],"安庆":[117.058739,30.537898],"蚌埠":[117.35708,32.929499],"亳州":[115.787928,33.871211],"巢湖":[117.88049,31.608733],"池州":[117.494477,30.660019],"滁州":[118.32457,32.317351],"阜阳":[115.820932,32.901211],"淮北":[116.791447,33.960023],"淮南":[117.018639,32.642812],"黄山":[118.29357,29.734435],"六安":[116.505253,31.755558],"马鞍山":[118.515882,31.688528],"宿州":[116.988692,33.636772],"铜陵":[117.819429,30.94093],"芜湖":[118.384108,31.36602],"宣城":[118.752096,30.951642],"福建":[117.984943,26.050118],"福州":[119.330221,26.047125],"龙岩":[117.017997,25.078685],"南平":[118.181883,26.643626],"宁德":[119.542082,26.656527],"莆田":[119.077731,25.44845],"泉州":[118.600362,24.901652],"三明":[117.642194,26.270835],"厦门":[118.103886,24.489231],"漳州":[117.676205,24.517065],"甘肃":[102.457625,38.103267],"兰州":[103.823305,36.064226],"白银":[104.171241,36.546682],"定西":[104.626638,35.586056],"甘南":[102.917442,34.992211],"嘉峪关":[98.281635,39.802397],"金昌":[102.208126,38.516072],"酒泉":[98.508415,39.741474],"临夏":[103.215249,35.598514],"陇南":[104.934573,33.39448],"平凉":[106.688911,35.55011],"庆阳":[107.644227,35.726801],"天水":[105.736932,34.584319],"武威":[102.640147,37.933172],"张掖":[100.459892,38.93932],"广东":[113.394818,23.408004],"广州":[113.30765,23.120049],"潮州":[116.630076,23.661812],"东莞":[113.763434,23.043024],"佛山":[113.134026,23.035095],"河源":[114.713721,23.757251],"惠州":[114.410658,23.11354],"江门":[113.078125,22.575117],"揭阳":[116.379501,23.547999],"茂名":[110.931245,21.668226],"梅州":[116.126403,24.304571],"清远":[113.040773,23.698469],"汕头":[116.72865,23.383908],"汕尾":[115.372924,22.778731],"韶关":[113.594461,24.80296],"深圳":[114.025974,22.546054],"阳江":[111.97701,21.871517],"云浮":[112.050946,22.937976],"湛江":[110.365067,21.257463],"肇庆":[112.479653,23.078663],"中山":[113.42206,22.545178],"珠海":[113.562447,22.256915],"东沙群岛":[117.309186,19.083978],"广西":[108.924274,23.552255],"南宁":[108.297234,22.806493],"百色":[106.631821,23.901512],"北海":[109.122628,21.472718],"崇左":[107.357322,22.415455],"防城港":[108.351791,21.617398],"桂林":[110.26092,25.262901],"贵港":[109.613708,23.103373],"河池":[108.069948,24.699521],"贺州":[111.552594,24.411054],"来宾":[109.231817,23.741166],"柳州":[109.422402,24.329053],"钦州":[108.638798,21.97335],"梧州":[111.305472,23.485395],"玉林":[110.151676,22.643974],"贵州":[106.734996,26.902826],"贵阳":[106.709177,26.629907],"安顺":[105.92827,26.228595],"毕节":[105.300492,27.302612],"六盘水":[104.852087,26.591866],"铜仁":[109.196161,27.726271],"遵义":[106.93126,27.699961],"黔西南":[104.900558,25.095148],"黔东南":[107.985353,26.583992],"黔南":[107.523205,26.264536],"海南":[100.624066,36.284364],"海口":[110.330802,20.022071],"白沙":[109.358586,19.216056],"保亭":[109.656113,18.597592],"昌江":[109.0113,19.222483],"儋州":[109.413973,19.571153],"澄迈":[109.996736,19.693135],"东方":[108.85101,18.998161],"定安":[110.32009,19.490991],"琼海":[110.414359,19.21483],"琼中":[109.861849,19.039771],"乐东":[109.062698,18.658614],"临高":[109.724101,19.805922],"陵水":[109.948661,18.575985],"三亚":[109.522771,18.257776],"屯昌":[110.063364,19.347749],"万宁":[110.292505,18.839886],"文昌":[110.780909,19.750947],"五指山":[109.51775,18.831306],"三沙":[112.342491,16.843901],"西沙群岛":[111.79977,16.219423],"南沙群岛":[114.736439,10.370353],"河北":[115.661434,38.61384],"石家庄":[114.522082,38.048958],"保定":[115.49481,38.886565],"沧州":[116.863806,38.297615],"承德":[117.933822,40.992521],"邯郸":[114.482694,36.609308],"衡水":[115.686229,37.746929],"廊坊":[116.703602,39.518611],"秦皇岛":[119.604368,39.945462],"唐山":[118.183451,39.650531],"邢台":[114.520487,37.069531],"张家口":[114.893782,40.811188],"河南":[113.486804,34.157184],"济源":[112.609183,35.073092],"郑州":[113.649644,34.75661],"安阳":[114.351807,36.110267],"鹤壁":[114.29777,35.755426],"焦作":[113.211836,35.234608],"开封":[114.351642,34.801854],"洛阳":[112.447525,34.657368],"漯河":[114.046061,33.576279],"南阳":[112.542842,33.01142],"平顶山":[113.300849,33.745301],"濮阳":[115.026627,35.753298],"三门峡":[111.181262,34.78332],"商丘":[115.641886,34.438589],"新乡":[113.91269,35.307258],"信阳":[114.085491,32.128582],"许昌":[113.835312,34.02674],"周口":[114.654102,33.623741],"驻马店":[114.049154,32.983158],"黑龙江":[128.047414,47.356592],"哈尔滨":[126.657717,45.773225],"大庆":[125.02184,46.596709],"大兴安岭":[124.196104,51.991789],"鹤岗":[130.292472,47.338666],"黑河":[127.50083,50.25069],"鸡西":[130.941767,45.32154],"佳木斯":[130.284735,46.81378],"牡丹江":[129.608035,44.588521],"七台河":[131.019048,45.775005],"齐齐哈尔":[123.987289,47.3477],"双鸭山":[131.171402,46.655102],"绥化":[126.989095,46.646064],"伊春":[128.910766,47.734685],"湖北":[112.410562,31.209316],"武汉":[114.3162,30.581084],"鄂州":[114.895594,30.384439],"恩施":[109.517433,30.308978],"黄冈":[114.906618,30.446109],"黄石":[115.050683,30.216127],"荆门":[112.21733,31.042611],"荆州":[112.241866,30.332591],"潜江":[112.768768,30.343116],"神农架":[110.487231,31.595768],"十堰":[110.801229,32.636994],"随州":[113.379358,31.717858],"天门":[113.12623,30.649047],"仙桃":[113.387448,30.293966],"咸宁":[114.300061,29.880657],"襄阳":[112.176326,32.094934],"孝感":[113.935734,30.927955],"宜昌":[111.310981,30.732758],"湖南":[111.720664,27.695864],"长沙":[112.979353,28.213478],"常德":[111.653718,29.012149],"郴州":[113.037704,25.782264],"衡阳":[112.583819,26.898164],"怀化":[109.986959,27.557483],"娄底":[111.996396,27.741073],"邵阳":[111.461525,27.236811],"湘潭":[112.935556,27.835095],"湘西":[109.745746,28.317951],"益阳":[112.366547,28.588088],"永州":[111.614648,26.435972],"岳阳":[113.146196,29.378007],"张家界":[110.48162,29.124889],"株洲":[113.131695,27.827433],"江苏":[119.368489,33.013797],"南京":[118.778074,32.057236],"常州":[119.981861,31.771397],"淮安":[119.030186,33.606513],"连云港":[119.173872,34.601549],"南通":[120.873801,32.014665],"苏州":[120.619907,31.317987],"宿迁":[118.296893,33.95205],"泰州":[119.919606,32.476053],"无锡":[120.305456,31.570037],"徐州":[117.188107,34.271553],"盐城":[120.148872,33.379862],"扬州":[119.427778,32.408505],"镇江":[119.455835,32.204409],"江西":[115.676082,27.757258],"南昌":[115.893528,28.689578],"抚州":[116.360919,27.954545],"赣州":[114.935909,25.845296],"吉安":[114.992039,27.113848],"景德镇":[117.186523,29.303563],"九江":[115.999848,29.71964],"萍乡":[113.859917,27.639544],"上饶":[117.955464,28.457623],"新余":[114.947117,27.822322],"宜春":[114.400039,27.81113],"鹰潭":[117.03545,28.24131],"吉林":[126.564544,43.871988],"长春":[125.313642,43.898338],"白城":[122.840777,45.621086],"白山":[126.435798,41.945859],"辽源":[125.133686,42.923303],"四平":[124.391382,43.175525],"松原":[124.832995,45.136049],"通化":[125.94265,41.736397],"延边":[129.485902,42.896414],"辽宁":[122.753592,41.6216],"沈阳":[123.432791,41.808645],"鞍山":[123.007763,41.118744],"本溪":[123.778062,41.325838],"朝阳":[120.446163,41.571828],"大连":[121.593478,38.94871],"丹东":[124.338543,40.129023],"抚顺":[123.92982,41.877304],"阜新":[121.660822,42.01925],"葫芦岛":[120.860758,40.74303],"锦州":[121.147749,41.130879],"辽阳":[123.172451,41.273339],"盘锦":[122.073228,41.141248],"铁岭":[123.85485,42.299757],"营口":[122.233391,40.668651],"内蒙古":[114.415868,43.468238],"呼和浩特":[111.660351,40.828319],"阿拉善":[105.695683,38.843075],"包头":[109.846239,40.647119],"巴彦淖尔":[107.423807,40.76918],"赤峰":[118.930761,42.297112],"鄂尔多斯":[109.993706,39.81649],"呼伦贝尔":[119.760822,49.201636],"通辽":[122.260363,43.633756],"乌海":[106.831999,39.683177],"乌兰察布":[113.112846,41.022363],"锡林郭勒":[116.02734,43.939705],"兴安盟":[122.048167,46.083757],"宁夏":[106.155481,37.321323],"银川":[106.206479,38.502621],"固原":[106.285268,36.021523],"石嘴山":[106.379337,39.020223],"吴忠":[106.208254,37.993561],"中卫":[105.196754,37.521124],"青海":[96.202544,35.499761],"西宁":[101.767921,36.640739],"果洛":[100.223723,34.480485],"海东":[102.085207,36.51761],"海北":[100.879802,36.960654],"海西":[97.342625,37.373799],"黄南":[102.0076,35.522852],"玉树":[97.013316,33.00624],"山东":[118.527663,36.09929],"济南":[117.024967,36.682785],"滨州":[117.968292,37.405314],"东营":[118.583926,37.487121],"德州":[116.328161,37.460826],"菏泽":[115.46336,35.26244],"济宁":[116.600798,35.402122],"莱芜":[117.684667,36.233654],"聊城":[115.986869,36.455829],"临沂":[118.340768,35.072409],"青岛":[120.384428,36.105215],"日照":[119.50718,35.420225],"泰安":[117.089415,36.188078],"威海":[122.093958,37.528787],"潍坊":[119.142634,36.716115],"烟台":[121.309555,37.536562],"枣庄":[117.279305,34.807883],"淄博":[118.059134,36.804685],"山西":[112.515496,37.866566],"太原":[112.550864,37.890277],"长治":[113.120292,36.201664],"大同":[113.290509,40.113744],"晋城":[112.867333,35.499834],"晋中":[112.738514,37.693362],"临汾":[111.538788,36.099745],"吕梁":[111.143157,37.527316],"朔州":[112.479928,39.337672],"忻州":[112.727939,38.461031],"阳泉":[113.569238,37.869529],"运城":[111.006854,35.038859],"陕西":[109.503789,35.860026],"西安":[108.953098,34.2778],"安康":[109.038045,32.70437],"宝鸡":[107.170645,34.364081],"汉中":[107.045478,33.081569],"商洛":[109.934208,33.873907],"铜川":[108.968067,34.908368],"渭南":[109.483933,34.502358],"咸阳":[108.707509,34.345373],"延安":[109.50051,36.60332],"榆林":[109.745926,38.279439],"四川":[102.89916,30.367481],"成都":[104.067923,30.679943],"阿坝":[102.228565,31.905763],"巴中":[106.757916,31.869189],"达州":[107.494973,31.214199],"德阳":[104.402398,31.13114],"甘孜":[101.969232,30.055144],"广安":[106.63572,30.463984],"广元":[105.819687,32.44104],"乐山":[103.760824,29.600958],"凉山":[102.259591,27.892393],"泸州":[105.44397,28.89593],"南充":[106.105554,30.800965],"眉山":[103.84143,30.061115],"绵阳":[104.705519,31.504701],"内江":[105.073056,29.599462],"攀枝花":[101.722423,26.587571],"遂宁":[105.564888,30.557491],"雅安":[103.009356,29.999716],"宜宾":[104.633019,28.769675],"资阳":[104.63593,30.132191],"自贡":[104.776071,29.359157],"西藏":[89.137982,31.367315],"拉萨":[91.111891,29.662557],"阿里":[81.107669,30.404557],"昌都":[97.185582,31.140576],"林芝":[94.349985,29.666941],"那曲":[92.067018,31.48068],"日喀则":[88.891486,29.269023],"山南":[91.750644,29.229027],"新疆":[85.614899,42.127001],"乌鲁木齐":[87.564988,43.84038],"阿拉尔":[81.291737,40.61568],"阿克苏":[80.269846,41.171731],"阿勒泰":[88.137915,47.839744],"巴音郭楞":[86.121688,41.771362],"博尔塔拉":[82.052436,44.913651],"昌吉":[87.296038,44.007058],"哈密":[93.528355,42.858596],"和田":[79.930239,37.116774],"喀什":[75.992973,39.470627],"克拉玛依":[84.88118,45.594331],"克孜勒苏":[76.137564,39.750346],"石河子":[86.041865,44.308259],"塔城":[82.974881,46.758684],"图木舒克":[79.198155,39.889223],"吐鲁番":[89.181595,42.96047],"五家渠":[87.565449,44.368899],"伊犁":[81.297854,43.922248],"云南":[101.592952,24.864213],"昆明":[102.714601,25.049153],"保山":[99.177996,25.120489],"楚雄":[101.529382,25.066356],"大理":[100.223675,25.5969],"德宏":[98.589434,24.44124],"迪庆":[99.713682,27.831029],"红河":[103.384065,23.367718],"丽江":[100.229628,26.875351],"临沧":[100.092613,23.887806],"怒江":[98.859932,25.860677],"普洱":[100.980058,22.788778],"曲靖":[103.782539,25.520758],"昭通":[103.725021,27.340633],"文山":[104.089112,23.401781],"西双版纳":[100.803038,22.009433],"玉溪":[102.545068,24.370447],"浙江":[119.957202,29.159494],"杭州":[120.219375,30.259244],"湖州":[120.137243,30.877925],"嘉兴":[120.760428,30.773992],"金华":[119.652576,29.102899],"丽水":[119.929576,28.4563],"宁波":[121.579006,29.885259],"衢州":[118.875842,28.95691],"绍兴":[120.592467,30.002365],"台州":[121.440613,28.668283],"温州":[120.690635,28.002838],"舟山":[122.169872,30.03601],"香港":[114.186124,22.293586],"澳门":[113.557519,22.204118],"台湾":[120.961454,23.80406],"台北":[121.489971,25.094466]};

             function getGeoCoord (name) {
             var city = name.split('_').pop();
             var coord;
             coord = geoCoord[city];
             return coord;
             }

             $.ajax({
             url: 'http://7xp3u9.com1.z0.glb.clouddn.com/srcmigration.json',
             type:"get",
             dataType: 'json',
             success: function(data) {
             for(var key in data){
             data[key].forEach(function (value, index) {
             data[key][index].num=Number(value.num);
             })
             }
             option.series[0].markLine.data = data.allLine.sort(function (a, b) {
             return b.num - a.num
             }).slice(0, 3000).map(function (line) {
             return [{
             geoCoord: getGeoCoord(line.start)
             }, {
             geoCoord: getGeoCoord(line.end)
             }]
             });

             option.series[0].markPoint.data = data.topCityOut.map(function (point) {
             return {
             geoCoord: getGeoCoord(point.name)
             }
             });
             //overlay.setOption(option);
             }
             });*/


            var option1 = {
                color: ['gold', 'aqua', 'lime'],
                title: {
                    text: '模拟迁徙',
                    subtext: '数据纯属虚构',
                    x: 'right'
                },
                tooltip: {
                    trigger: 'item',
                    formatter: function (v) {
                        return v[1].replace(':', ' > ');
                    }
                },
                legend: {
                    orient: 'vertical',
                    x: 'left',
                    data: ['北京', '上海', '广州', '全国'],
                    selectedMode: 'single',
                    selected: {
                        '上海': false,
                        '广州': false
                    }
                },
                /*toolbox: {
                 show : true,
                 orient : 'vertical',
                 x: 'right',
                 y: 'center',
                 feature : {
                 mark : {show: true},
                 dataView : {show: true, readOnly: false},
                 restore : {show: true},
                 saveAsImage : {show: true}
                 }
                 },*/
                dataRange: {
                    min: 0,
                    max: 100,
                    y: '60%',
                    calculable: true,
                    color: ['#ff3333', 'orange', 'yellow', 'lime', 'aqua']
                },
                series: [
                    {
                        name: '北京',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        geoCoord: {
                            '上海': [121.4648, 31.2891],
                            '东莞': [113.8953, 22.901],
                            '东营': [118.7073, 37.5513],
                            '中山': [113.4229, 22.478],
                            '临汾': [111.4783, 36.1615],
                            '临沂': [118.3118, 35.2936],
                            '丹东': [124.541, 40.4242],
                            '丽水': [119.5642, 28.1854],
                            '乌鲁木齐': [87.9236, 43.5883],
                            '佛山': [112.8955, 23.1097],
                            '保定': [115.0488, 39.0948],
                            '兰州': [103.5901, 36.3043],
                            '包头': [110.3467, 41.4899],
                            '北京': [116.4551, 40.2539],
                            '北海': [109.314, 21.6211],
                            '南京': [118.8062, 31.9208],
                            '南宁': [108.479, 23.1152],
                            '南昌': [116.0046, 28.6633],
                            '南通': [121.1023, 32.1625],
                            '厦门': [118.1689, 24.6478],
                            '台州': [121.1353, 28.6688],
                            '合肥': [117.29, 32.0581],
                            '呼和浩特': [111.4124, 40.4901],
                            '咸阳': [108.4131, 34.8706],
                            '哈尔滨': [127.9688, 45.368],
                            '唐山': [118.4766, 39.6826],
                            '嘉兴': [120.9155, 30.6354],
                            '大同': [113.7854, 39.8035],
                            '大连': [122.2229, 39.4409],
                            '天津': [117.4219, 39.4189],
                            '太原': [112.3352, 37.9413],
                            '威海': [121.9482, 37.1393],
                            '宁波': [121.5967, 29.6466],
                            '宝鸡': [107.1826, 34.3433],
                            '宿迁': [118.5535, 33.7775],
                            '常州': [119.4543, 31.5582],
                            '广州': [113.5107, 23.2196],
                            '廊坊': [116.521, 39.0509],
                            '延安': [109.1052, 36.4252],
                            '张家口': [115.1477, 40.8527],
                            '徐州': [117.5208, 34.3268],
                            '德州': [116.6858, 37.2107],
                            '惠州': [114.6204, 23.1647],
                            '成都': [103.9526, 30.7617],
                            '扬州': [119.4653, 32.8162],
                            '承德': [117.5757, 41.4075],
                            '拉萨': [91.1865, 30.1465],
                            '无锡': [120.3442, 31.5527],
                            '日照': [119.2786, 35.5023],
                            '昆明': [102.9199, 25.4663],
                            '杭州': [119.5313, 29.8773],
                            '枣庄': [117.323, 34.8926],
                            '柳州': [109.3799, 24.9774],
                            '株洲': [113.5327, 27.0319],
                            '武汉': [114.3896, 30.6628],
                            '汕头': [117.1692, 23.3405],
                            '江门': [112.6318, 22.1484],
                            '沈阳': [123.1238, 42.1216],
                            '沧州': [116.8286, 38.2104],
                            '河源': [114.917, 23.9722],
                            '泉州': [118.3228, 25.1147],
                            '泰安': [117.0264, 36.0516],
                            '泰州': [120.0586, 32.5525],
                            '济南': [117.1582, 36.8701],
                            '济宁': [116.8286, 35.3375],
                            '海口': [110.3893, 19.8516],
                            '淄博': [118.0371, 36.6064],
                            '淮安': [118.927, 33.4039],
                            '深圳': [114.5435, 22.5439],
                            '清远': [112.9175, 24.3292],
                            '温州': [120.498, 27.8119],
                            '渭南': [109.7864, 35.0299],
                            '湖州': [119.8608, 30.7782],
                            '湘潭': [112.5439, 27.7075],
                            '滨州': [117.8174, 37.4963],
                            '潍坊': [119.0918, 36.524],
                            '烟台': [120.7397, 37.5128],
                            '玉溪': [101.9312, 23.8898],
                            '珠海': [113.7305, 22.1155],
                            '盐城': [120.2234, 33.5577],
                            '盘锦': [121.9482, 41.0449],
                            '石家庄': [114.4995, 38.1006],
                            '福州': [119.4543, 25.9222],
                            '秦皇岛': [119.2126, 40.0232],
                            '绍兴': [120.564, 29.7565],
                            '聊城': [115.9167, 36.4032],
                            '肇庆': [112.1265, 23.5822],
                            '舟山': [122.2559, 30.2234],
                            '苏州': [120.6519, 31.3989],
                            '莱芜': [117.6526, 36.2714],
                            '菏泽': [115.6201, 35.2057],
                            '营口': [122.4316, 40.4297],
                            '葫芦岛': [120.1575, 40.578],
                            '衡水': [115.8838, 37.7161],
                            '衢州': [118.6853, 28.8666],
                            '西宁': [101.4038, 36.8207],
                            '西安': [109.1162, 34.2004],
                            '贵阳': [106.6992, 26.7682],
                            '连云港': [119.1248, 34.552],
                            '邢台': [114.8071, 37.2821],
                            '邯郸': [114.4775, 36.535],
                            '郑州': [113.4668, 34.6234],
                            '鄂尔多斯': [108.9734, 39.2487],
                            '重庆': [107.7539, 30.1904],
                            '金华': [120.0037, 29.1028],
                            '铜川': [109.0393, 35.1947],
                            '银川': [106.3586, 38.1775],
                            '镇江': [119.4763, 31.9702],
                            '长春': [125.8154, 44.2584],
                            '长沙': [113.0823, 28.2568],
                            '长治': [112.8625, 36.4746],
                            '阳泉': [113.4778, 38.0951],
                            '青岛': [120.4651, 36.3373],
                            '韶关': [113.7964, 24.7028]
                        },

                        markLine: {
                            smooth: true,
                            effect: {
                                show: true,
                                scaleSize: 1,
                                period: 30,
                                color: '#fff',
                                shadowBlur: 10
                            },
                            itemStyle: {
                                normal: {
                                    borderWidth: 1,
                                    lineStyle: {
                                        type: 'solid',
                                        shadowBlur: 10
                                    }
                                }
                            },
                            data: [
                                [{name: '北京'}, {name: '上海', value: 95}],
                                [{name: '北京'}, {name: '广州', value: 90}],
                                [{name: '北京'}, {name: '大连', value: 80}],
                                [{name: '北京'}, {name: '南宁', value: 70}],
                                [{name: '北京'}, {name: '南昌', value: 60}],
                                [{name: '北京'}, {name: '拉萨', value: 50}],
                                [{name: '北京'}, {name: '长春', value: 40}],
                                [{name: '北京'}, {name: '包头', value: 30}],
                                [{name: '北京'}, {name: '重庆', value: 20}],
                                [{name: '北京'}, {name: '常州', value: 10}]
                            ]
                        },
                        markPoint: {
                            symbol: 'emptyCircle',
                            symbolSize: function (v) {
                                return 10 + v / 10
                            },
                            effect: {
                                show: true,
                                shadowBlur: 0
                            },
                            itemStyle: {
                                normal: {
                                    label: {show: false}
                                }
                            },
                            data: [
                                {name: '上海', value: 95},
                                {name: '广州', value: 90},
                                {name: '大连', value: 80},
                                {name: '南宁', value: 70},
                                {name: '南昌', value: 60},
                                {name: '拉萨', value: 50},
                                {name: '长春', value: 40},
                                {name: '包头', value: 30},
                                {name: '重庆', value: 20},
                                {name: '常州', value: 10}
                            ]
                        }

                    },
                    {
                        name: '上海',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        markLine: {
                            smooth: true,
                            effect: {
                                show: true,
                                scaleSize: 1,
                                period: 30,
                                color: '#fff',
                                shadowBlur: 10
                            },
                            itemStyle: {
                                normal: {
                                    borderWidth: 1,
                                    lineStyle: {
                                        type: 'solid',
                                        shadowBlur: 10
                                    }
                                }
                            },
                            data: [
                                [{name: '上海'}, {name: '包头', value: 95}],
                                [{name: '上海'}, {name: '昆明', value: 90}],
                                [{name: '上海'}, {name: '广州', value: 80}],
                                [{name: '上海'}, {name: '郑州', value: 70}],
                                [{name: '上海'}, {name: '长春', value: 60}],
                                [{name: '上海'}, {name: '重庆', value: 50}],
                                [{name: '上海'}, {name: '长沙', value: 40}],
                                [{name: '上海'}, {name: '北京', value: 30}],
                                [{name: '上海'}, {name: '丹东', value: 20}],
                                [{name: '上海'}, {name: '大连', value: 10}]
                            ]
                        },
                        markPoint: {
                            symbol: 'emptyCircle',
                            symbolSize: function (v) {
                                return 10 + v / 10
                            },
                            effect: {
                                show: true,
                                shadowBlur: 0
                            },
                            itemStyle: {
                                normal: {
                                    label: {show: false}
                                }
                            },
                            data: [
                                {name: '包头', value: 95},
                                {name: '昆明', value: 90},
                                {name: '广州', value: 80},
                                {name: '郑州', value: 70},
                                {name: '长春', value: 60},
                                {name: '重庆', value: 50},
                                {name: '长沙', value: 40},
                                {name: '北京', value: 30},
                                {name: '丹东', value: 20},
                                {name: '大连', value: 10}
                            ]
                        }
                    },
                    {
                        name: '广州',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        markLine: {
                            smooth: true,
                            effect: {
                                show: true,
                                scaleSize: 1,
                                period: 30,
                                color: '#fff',
                                shadowBlur: 10
                            },
                            itemStyle: {
                                normal: {
                                    borderWidth: 1,
                                    lineStyle: {
                                        type: 'solid',
                                        shadowBlur: 10
                                    }
                                }
                            },
                            data: [
                                [{name: '广州'}, {name: '福州', value: 95}],
                                [{name: '广州'}, {name: '太原', value: 90}],
                                [{name: '广州'}, {name: '长春', value: 80}],
                                [{name: '广州'}, {name: '重庆', value: 70}],
                                [{name: '广州'}, {name: '西安', value: 60}],
                                [{name: '广州'}, {name: '成都', value: 50}],
                                [{name: '广州'}, {name: '常州', value: 40}],
                                [{name: '广州'}, {name: '北京', value: 30}],
                                [{name: '广州'}, {name: '北海', value: 20}],
                                [{name: '广州'}, {name: '海口', value: 10}]
                            ]
                        },
                        markPoint: {
                            symbol: 'emptyCircle',
                            symbolSize: function (v) {
                                return 10 + v / 10
                            },
                            effect: {
                                show: true,
                                shadowBlur: 0
                            },
                            itemStyle: {
                                normal: {
                                    label: {show: false}
                                }
                            },
                            data: [
                                {name: '福州', value: 95},
                                {name: '太原', value: 90},
                                {name: '长春', value: 80},
                                {name: '重庆', value: 70},
                                {name: '西安', value: 60},
                                {name: '成都', value: 50},
                                {name: '常州', value: 40},
                                {name: '北京', value: 30},
                                {name: '北海', value: 20},
                                {name: '海口', value: 10}
                            ]
                        }
                    },
                    {
                        name: '全国',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        markLine: {
                            smooth: true,
                            symbol: ['none', 'circle'],
                            symbolSize: 1,
                            itemStyle: {
                                normal: {
                                    color: '#fff',
                                    borderWidth: 1,
                                    borderColor: 'rgba(30,144,255,0.5)'
                                }
                            },
                            data: [
                                [{name: '北京'}, {name: '包头'}],
                                [{name: '北京'}, {name: '北海'}],
                                [{name: '北京'}, {name: '广州'}],
                                [{name: '北京'}, {name: '郑州'}],
                                [{name: '北京'}, {name: '长春'}],
                                [{name: '北京'}, {name: '长治'}],
                                [{name: '北京'}, {name: '重庆'}],
                                [{name: '北京'}, {name: '长沙'}],
                                [{name: '北京'}, {name: '成都'}],
                                [{name: '北京'}, {name: '常州'}],
                                [{name: '北京'}, {name: '丹东'}],
                                [{name: '北京'}, {name: '大连'}],
                                [{name: '北京'}, {name: '东营'}],
                                [{name: '北京'}, {name: '延安'}],
                                [{name: '北京'}, {name: '福州'}],
                                [{name: '北京'}, {name: '海口'}],
                                [{name: '北京'}, {name: '呼和浩特'}],
                                [{name: '北京'}, {name: '合肥'}],
                                [{name: '北京'}, {name: '杭州'}],
                                [{name: '北京'}, {name: '哈尔滨'}],
                                [{name: '北京'}, {name: '舟山'}],
                                [{name: '北京'}, {name: '银川'}],
                                [{name: '北京'}, {name: '衢州'}],
                                [{name: '北京'}, {name: '南昌'}],
                                [{name: '北京'}, {name: '昆明'}],
                                [{name: '北京'}, {name: '贵阳'}],
                                [{name: '北京'}, {name: '兰州'}],
                                [{name: '北京'}, {name: '拉萨'}],
                                [{name: '北京'}, {name: '连云港'}],
                                [{name: '北京'}, {name: '临沂'}],
                                [{name: '北京'}, {name: '柳州'}],
                                [{name: '北京'}, {name: '宁波'}],
                                [{name: '北京'}, {name: '南京'}],
                                [{name: '北京'}, {name: '南宁'}],
                                [{name: '北京'}, {name: '南通'}],
                                [{name: '北京'}, {name: '上海'}],
                                [{name: '北京'}, {name: '沈阳'}],
                                [{name: '北京'}, {name: '西安'}],
                                [{name: '北京'}, {name: '汕头'}],
                                [{name: '北京'}, {name: '深圳'}],
                                [{name: '北京'}, {name: '青岛'}],
                                [{name: '北京'}, {name: '济南'}],
                                [{name: '北京'}, {name: '太原'}],
                                [{name: '北京'}, {name: '乌鲁木齐'}],
                                [{name: '北京'}, {name: '潍坊'}],
                                [{name: '北京'}, {name: '威海'}],
                                [{name: '北京'}, {name: '温州'}],
                                [{name: '北京'}, {name: '武汉'}],
                                [{name: '北京'}, {name: '无锡'}],
                                [{name: '北京'}, {name: '厦门'}],
                                [{name: '北京'}, {name: '西宁'}],
                                [{name: '北京'}, {name: '徐州'}],
                                [{name: '北京'}, {name: '烟台'}],
                                [{name: '北京'}, {name: '盐城'}],
                                [{name: '北京'}, {name: '珠海'}],
                                [{name: '上海'}, {name: '包头'}],
                                [{name: '上海'}, {name: '北海'}],
                                [{name: '上海'}, {name: '广州'}],
                                [{name: '上海'}, {name: '郑州'}],
                                [{name: '上海'}, {name: '长春'}],
                                [{name: '上海'}, {name: '重庆'}],
                                [{name: '上海'}, {name: '长沙'}],
                                [{name: '上海'}, {name: '成都'}],
                                [{name: '上海'}, {name: '丹东'}],
                                [{name: '上海'}, {name: '大连'}],
                                [{name: '上海'}, {name: '福州'}],
                                [{name: '上海'}, {name: '海口'}],
                                [{name: '上海'}, {name: '呼和浩特'}],
                                [{name: '上海'}, {name: '合肥'}],
                                [{name: '上海'}, {name: '哈尔滨'}],
                                [{name: '上海'}, {name: '舟山'}],
                                [{name: '上海'}, {name: '银川'}],
                                [{name: '上海'}, {name: '南昌'}],
                                [{name: '上海'}, {name: '昆明'}],
                                [{name: '上海'}, {name: '贵阳'}],
                                [{name: '上海'}, {name: '兰州'}],
                                [{name: '上海'}, {name: '拉萨'}],
                                [{name: '上海'}, {name: '连云港'}],
                                [{name: '上海'}, {name: '临沂'}],
                                [{name: '上海'}, {name: '柳州'}],
                                [{name: '上海'}, {name: '宁波'}],
                                [{name: '上海'}, {name: '南宁'}],
                                [{name: '上海'}, {name: '北京'}],
                                [{name: '上海'}, {name: '沈阳'}],
                                [{name: '上海'}, {name: '秦皇岛'}],
                                [{name: '上海'}, {name: '西安'}],
                                [{name: '上海'}, {name: '石家庄'}],
                                [{name: '上海'}, {name: '汕头'}],
                                [{name: '上海'}, {name: '深圳'}],
                                [{name: '上海'}, {name: '青岛'}],
                                [{name: '上海'}, {name: '济南'}],
                                [{name: '上海'}, {name: '天津'}],
                                [{name: '上海'}, {name: '太原'}],
                                [{name: '上海'}, {name: '乌鲁木齐'}],
                                [{name: '上海'}, {name: '潍坊'}],
                                [{name: '上海'}, {name: '威海'}],
                                [{name: '上海'}, {name: '温州'}],
                                [{name: '上海'}, {name: '武汉'}],
                                [{name: '上海'}, {name: '厦门'}],
                                [{name: '上海'}, {name: '西宁'}],
                                [{name: '上海'}, {name: '徐州'}],
                                [{name: '上海'}, {name: '烟台'}],
                                [{name: '上海'}, {name: '珠海'}],
                                [{name: '广州'}, {name: '北海'}],
                                [{name: '广州'}, {name: '郑州'}],
                                [{name: '广州'}, {name: '长春'}],
                                [{name: '广州'}, {name: '重庆'}],
                                [{name: '广州'}, {name: '长沙'}],
                                [{name: '广州'}, {name: '成都'}],
                                [{name: '广州'}, {name: '常州'}],
                                [{name: '广州'}, {name: '大连'}],
                                [{name: '广州'}, {name: '福州'}],
                                [{name: '广州'}, {name: '海口'}],
                                [{name: '广州'}, {name: '呼和浩特'}],
                                [{name: '广州'}, {name: '合肥'}],
                                [{name: '广州'}, {name: '杭州'}],
                                [{name: '广州'}, {name: '哈尔滨'}],
                                [{name: '广州'}, {name: '舟山'}],
                                [{name: '广州'}, {name: '银川'}],
                                [{name: '广州'}, {name: '南昌'}],
                                [{name: '广州'}, {name: '昆明'}],
                                [{name: '广州'}, {name: '贵阳'}],
                                [{name: '广州'}, {name: '兰州'}],
                                [{name: '广州'}, {name: '拉萨'}],
                                [{name: '广州'}, {name: '连云港'}],
                                [{name: '广州'}, {name: '临沂'}],
                                [{name: '广州'}, {name: '柳州'}],
                                [{name: '广州'}, {name: '宁波'}],
                                [{name: '广州'}, {name: '南京'}],
                                [{name: '广州'}, {name: '南宁'}],
                                [{name: '广州'}, {name: '南通'}],
                                [{name: '广州'}, {name: '北京'}],
                                [{name: '广州'}, {name: '上海'}],
                                [{name: '广州'}, {name: '沈阳'}],
                                [{name: '广州'}, {name: '西安'}],
                                [{name: '广州'}, {name: '石家庄'}],
                                [{name: '广州'}, {name: '汕头'}],
                                [{name: '广州'}, {name: '青岛'}],
                                [{name: '广州'}, {name: '济南'}],
                                [{name: '广州'}, {name: '天津'}],
                                [{name: '广州'}, {name: '太原'}],
                                [{name: '广州'}, {name: '乌鲁木齐'}],
                                [{name: '广州'}, {name: '温州'}],
                                [{name: '广州'}, {name: '武汉'}],
                                [{name: '广州'}, {name: '无锡'}],
                                [{name: '广州'}, {name: '厦门'}],
                                [{name: '广州'}, {name: '西宁'}],
                                [{name: '广州'}, {name: '徐州'}],
                                [{name: '广州'}, {name: '烟台'}],
                                [{name: '广州'}, {name: '盐城'}]
                            ]
                        }
                    }
                ]
            };
            overlay.setOption(option1);

            var option2 = {
                title: {
                    text: '订单量',
                    subtext: '纯属虚构',
                    x: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    x: 'left',
                    data: ['订单量']
                },
                dataRange: {
                    x: 'left',
                    y: 'bottom',
                    splitList: [
                        {start: 1500},
                        {start: 900, end: 1500},
                        {start: 310, end: 1000},
                        {start: 200, end: 300},
                        {start: 10, end: 200, label: '10 到 200（自定义label）'},
                        {start: 5, end: 5, label: '5（自定义特殊颜色）', color: 'black'},
                        {end: 10}
                    ],
                    color: ['#E0022B', '#E09107', '#A3E00B']
                },
                toolbox: {
                    show: true,
                    orient: 'vertical',
                    x: 'right',
                    y: 'center',
                    feature: {
                        mark: {show: true},
                        dataView: {show: true, readOnly: false},
                        restore: {show: true},
                        saveAsImage: {show: true}
                    }
                },
                series: [
                    {
                        name: '订单量',
                        type: 'map',
                        mapType: 'china',
                        roam: false,
                        itemStyle: {
                            normal: {
                                label: {
                                    show: true,
                                    textStyle: {
                                        color: "rgb(249, 249, 249)"
                                    }
                                }
                            },
                            emphasis: {label: {show: true}}
                        },
                        data: [
                            {name: '北京', value: Math.round(Math.random() * 2000)},
                            {name: '天津', value: Math.round(Math.random() * 2000)},
                            {name: '上海', value: Math.round(Math.random() * 2000)},
                            {name: '重庆', value: Math.round(Math.random() * 2000)},
                            {name: '河北', value: 0},
                            {name: '河南', value: Math.round(Math.random() * 2000)},
                            {name: '云南', value: 5},
                            {name: '辽宁', value: 305},
                            {name: '黑龙江', value: Math.round(Math.random() * 2000)},
                            {name: '湖南', value: 200},
                            {name: '安徽', value: Math.round(Math.random() * 2000)},
                            {name: '山东', value: Math.round(Math.random() * 2000)},
                            {name: '新疆', value: Math.round(Math.random() * 2000)},
                            {name: '江苏', value: Math.round(Math.random() * 2000)},
                            {name: '浙江', value: Math.round(Math.random() * 2000)},
                            {name: '江西', value: Math.round(Math.random() * 2000)},
                            {name: '湖北', value: Math.round(Math.random() * 2000)},
                            {name: '广西', value: Math.round(Math.random() * 2000)},
                            {name: '甘肃', value: Math.round(Math.random() * 2000)},
                            {name: '山西', value: Math.round(Math.random() * 2000)},
                            {name: '内蒙古', value: Math.round(Math.random() * 2000)},
                            {name: '陕西', value: Math.round(Math.random() * 2000)},
                            {name: '吉林', value: Math.round(Math.random() * 2000)},
                            {name: '福建', value: Math.round(Math.random() * 2000)},
                            {name: '贵州', value: Math.round(Math.random() * 2000)},
                            {name: '广东', value: Math.round(Math.random() * 2000)},
                            {name: '青海', value: Math.round(Math.random() * 2000)},
                            {name: '西藏', value: Math.round(Math.random() * 2000)},
                            {name: '四川', value: Math.round(Math.random() * 2000)},
                            {name: '宁夏', value: Math.round(Math.random() * 2000)},
                            {name: '海南', value: Math.round(Math.random() * 2000)},
                            {name: '台湾', value: Math.round(Math.random() * 2000)},
                            {name: '香港', value: Math.round(Math.random() * 2000)},
                            {name: '澳门', value: Math.round(Math.random() * 2000)}
                        ]
                    }
                ]
            };
            //overlay.setOption(option2);

            var placeList = [
                {name: '海门', geoCoord: [121.15, 31.89]},
                {name: '鄂尔多斯', geoCoord: [109.781327, 39.608266]},
                {name: '招远', geoCoord: [120.38, 37.35]},
                {name: '舟山', geoCoord: [122.207216, 29.985295]},
                {name: '齐齐哈尔', geoCoord: [123.97, 47.33]},
                {name: '盐城', geoCoord: [120.13, 33.38]},
                {name: '赤峰', geoCoord: [118.87, 42.28]},
                {name: '青岛', geoCoord: [120.33, 36.07]},
                {name: '乳山', geoCoord: [121.52, 36.89]},
                {name: '金昌', geoCoord: [102.188043, 38.520089]},
                {name: '泉州', geoCoord: [118.58, 24.93]},
                {name: '莱西', geoCoord: [120.53, 36.86]},
                {name: '日照', geoCoord: [119.46, 35.42]},
                {name: '胶南', geoCoord: [119.97, 35.88]},
                {name: '南通', geoCoord: [121.05, 32.08]},
                {name: '拉萨', geoCoord: [91.11, 29.97]},
                {name: '云浮', geoCoord: [112.02, 22.93]},
                {name: '梅州', geoCoord: [116.1, 24.55]},
                {name: '文登', geoCoord: [122.05, 37.2]},
                {name: '上海', geoCoord: [121.48, 31.22]},
                {name: '攀枝花', geoCoord: [101.718637, 26.582347]},
                {name: '威海', geoCoord: [122.1, 37.5]},
                {name: '承德', geoCoord: [117.93, 40.97]},
                {name: '厦门', geoCoord: [118.1, 24.46]},
                {name: '汕尾', geoCoord: [115.375279, 22.786211]},
                {name: '潮州', geoCoord: [116.63, 23.68]},
                {name: '丹东', geoCoord: [124.37, 40.13]},
                {name: '太仓', geoCoord: [121.1, 31.45]},
                {name: '曲靖', geoCoord: [103.79, 25.51]},
                {name: '烟台', geoCoord: [121.39, 37.52]},
                {name: '福州', geoCoord: [119.3, 26.08]},
                {name: '瓦房店', geoCoord: [121.979603, 39.627114]},
                {name: '即墨', geoCoord: [120.45, 36.38]},
                {name: '抚顺', geoCoord: [123.97, 41.97]},
                {name: '玉溪', geoCoord: [102.52, 24.35]},
                {name: '张家口', geoCoord: [114.87, 40.82]},
                {name: '阳泉', geoCoord: [113.57, 37.85]},
                {name: '莱州', geoCoord: [119.942327, 37.177017]},
                {name: '湖州', geoCoord: [120.1, 30.86]},
                {name: '汕头', geoCoord: [116.69, 23.39]},
                {name: '昆山', geoCoord: [120.95, 31.39]},
                {name: '宁波', geoCoord: [121.56, 29.86]},
                {name: '湛江', geoCoord: [110.359377, 21.270708]},
                {name: '揭阳', geoCoord: [116.35, 23.55]},
                {name: '荣成', geoCoord: [122.41, 37.16]},
                {name: '连云港', geoCoord: [119.16, 34.59]},
                {name: '葫芦岛', geoCoord: [120.836932, 40.711052]},
                {name: '常熟', geoCoord: [120.74, 31.64]},
                {name: '东莞', geoCoord: [113.75, 23.04]},
                {name: '河源', geoCoord: [114.68, 23.73]},
                {name: '淮安', geoCoord: [119.15, 33.5]},
                {name: '泰州', geoCoord: [119.9, 32.49]},
                {name: '南宁', geoCoord: [108.33, 22.84]},
                {name: '营口', geoCoord: [122.18, 40.65]},
                {name: '惠州', geoCoord: [114.4, 23.09]},
                {name: '江阴', geoCoord: [120.26, 31.91]},
                {name: '蓬莱', geoCoord: [120.75, 37.8]},
                {name: '韶关', geoCoord: [113.62, 24.84]},
                {name: '嘉峪关', geoCoord: [98.289152, 39.77313]},
                {name: '广州', geoCoord: [113.23, 23.16]},
                {name: '延安', geoCoord: [109.47, 36.6]},
                {name: '太原', geoCoord: [112.53, 37.87]},
                {name: '清远', geoCoord: [113.01, 23.7]},
                {name: '中山', geoCoord: [113.38, 22.52]},
                {name: '昆明', geoCoord: [102.73, 25.04]},
                {name: '寿光', geoCoord: [118.73, 36.86]},
                {name: '盘锦', geoCoord: [122.070714, 41.119997]},
                {name: '长治', geoCoord: [113.08, 36.18]},
                {name: '深圳', geoCoord: [114.07, 22.62]},
                {name: '珠海', geoCoord: [113.52, 22.3]},
                {name: '宿迁', geoCoord: [118.3, 33.96]},
                {name: '咸阳', geoCoord: [108.72, 34.36]},
                {name: '铜川', geoCoord: [109.11, 35.09]},
                {name: '平度', geoCoord: [119.97, 36.77]},
                {name: '佛山', geoCoord: [113.11, 23.05]},
                {name: '海口', geoCoord: [110.35, 20.02]},
                {name: '江门', geoCoord: [113.06, 22.61]},
                {name: '章丘', geoCoord: [117.53, 36.72]},
                {name: '肇庆', geoCoord: [112.44, 23.05]},
                {name: '大连', geoCoord: [121.62, 38.92]},
                {name: '临汾', geoCoord: [111.5, 36.08]},
                {name: '吴江', geoCoord: [120.63, 31.16]},
                {name: '石嘴山', geoCoord: [106.39, 39.04]},
                {name: '沈阳', geoCoord: [123.38, 41.8]},
                {name: '苏州', geoCoord: [120.62, 31.32]},
                {name: '茂名', geoCoord: [110.88, 21.68]},
                {name: '嘉兴', geoCoord: [120.76, 30.77]},
                {name: '长春', geoCoord: [125.35, 43.88]},
                {name: '胶州', geoCoord: [120.03336, 36.264622]},
                {name: '银川', geoCoord: [106.27, 38.47]},
                {name: '张家港', geoCoord: [120.555821, 31.875428]},
                {name: '三门峡', geoCoord: [111.19, 34.76]},
                {name: '锦州', geoCoord: [121.15, 41.13]},
                {name: '南昌', geoCoord: [115.89, 28.68]},
                {name: '柳州', geoCoord: [109.4, 24.33]},
                {name: '三亚', geoCoord: [109.511909, 18.252847]},
                {name: '自贡', geoCoord: [104.778442, 29.33903]},
                {name: '吉林', geoCoord: [126.57, 43.87]},
                {name: '阳江', geoCoord: [111.95, 21.85]},
                {name: '泸州', geoCoord: [105.39, 28.91]},
                {name: '西宁', geoCoord: [101.74, 36.56]},
                {name: '宜宾', geoCoord: [104.56, 29.77]},
                {name: '呼和浩特', geoCoord: [111.65, 40.82]},
                {name: '成都', geoCoord: [104.06, 30.67]},
                {name: '大同', geoCoord: [113.3, 40.12]},
                {name: '镇江', geoCoord: [119.44, 32.2]},
                {name: '桂林', geoCoord: [110.28, 25.29]},
                {name: '张家界', geoCoord: [110.479191, 29.117096]},
                {name: '宜兴', geoCoord: [119.82, 31.36]},
                {name: '北海', geoCoord: [109.12, 21.49]},
                {name: '西安', geoCoord: [108.95, 34.27]},
                {name: '金坛', geoCoord: [119.56, 31.74]},
                {name: '东营', geoCoord: [118.49, 37.46]},
                {name: '牡丹江', geoCoord: [129.58, 44.6]},
                {name: '遵义', geoCoord: [106.9, 27.7]},
                {name: '绍兴', geoCoord: [120.58, 30.01]},
                {name: '扬州', geoCoord: [119.42, 32.39]},
                {name: '常州', geoCoord: [119.95, 31.79]},
                {name: '潍坊', geoCoord: [119.1, 36.62]},
                {name: '重庆', geoCoord: [106.54, 29.59]},
                {name: '台州', geoCoord: [121.420757, 28.656386]},
                {name: '南京', geoCoord: [118.78, 32.04]},
                {name: '滨州', geoCoord: [118.03, 37.36]},
                {name: '贵阳', geoCoord: [106.71, 26.57]},
                {name: '无锡', geoCoord: [120.29, 31.59]},
                {name: '本溪', geoCoord: [123.73, 41.3]},
                {name: '克拉玛依', geoCoord: [84.77, 45.59]},
                {name: '渭南', geoCoord: [109.5, 34.52]},
                {name: '马鞍山', geoCoord: [118.48, 31.56]},
                {name: '宝鸡', geoCoord: [107.15, 34.38]},
                {name: '焦作', geoCoord: [113.21, 35.24]},
                {name: '句容', geoCoord: [119.16, 31.95]},
                {name: '北京', geoCoord: [116.46, 39.92]},
                {name: '徐州', geoCoord: [117.2, 34.26]},
                {name: '衡水', geoCoord: [115.72, 37.72]},
                {name: '包头', geoCoord: [110, 40.58]},
                {name: '绵阳', geoCoord: [104.73, 31.48]},
                {name: '乌鲁木齐', geoCoord: [87.68, 43.77]},
                {name: '枣庄', geoCoord: [117.57, 34.86]},
                {name: '杭州', geoCoord: [120.19, 30.26]},
                {name: '淄博', geoCoord: [118.05, 36.78]},
                {name: '鞍山', geoCoord: [122.85, 41.12]},
                {name: '溧阳', geoCoord: [119.48, 31.43]},
                {name: '库尔勒', geoCoord: [86.06, 41.68]},
                {name: '安阳', geoCoord: [114.35, 36.1]},
                {name: '开封', geoCoord: [114.35, 34.79]},
                {name: '济南', geoCoord: [117, 36.65]},
                {name: '德阳', geoCoord: [104.37, 31.13]},
                {name: '温州', geoCoord: [120.65, 28.01]},
                {name: '九江', geoCoord: [115.97, 29.71]},
                {name: '邯郸', geoCoord: [114.47, 36.6]},
                {name: '临安', geoCoord: [119.72, 30.23]},
                {name: '兰州', geoCoord: [103.73, 36.03]},
                {name: '沧州', geoCoord: [116.83, 38.33]},
                {name: '临沂', geoCoord: [118.35, 35.05]},
                {name: '南充', geoCoord: [106.110698, 30.837793]},
                {name: '天津', geoCoord: [117.2, 39.13]},
                {name: '富阳', geoCoord: [119.95, 30.07]},
                {name: '泰安', geoCoord: [117.13, 36.18]},
                {name: '诸暨', geoCoord: [120.23, 29.71]},
                {name: '郑州', geoCoord: [113.65, 34.76]},
                {name: '哈尔滨', geoCoord: [126.63, 45.75]},
                {name: '聊城', geoCoord: [115.97, 36.45]},
                {name: '芜湖', geoCoord: [118.38, 31.33]},
                {name: '唐山', geoCoord: [118.02, 39.63]},
                {name: '平顶山', geoCoord: [113.29, 33.75]},
                {name: '邢台', geoCoord: [114.48, 37.05]},
                {name: '德州', geoCoord: [116.29, 37.45]},
                {name: '济宁', geoCoord: [116.59, 35.38]},
                {name: '荆州', geoCoord: [112.239741, 30.335165]},
                {name: '宜昌', geoCoord: [111.3, 30.7]},
                {name: '义乌', geoCoord: [120.06, 29.32]},
                {name: '丽水', geoCoord: [119.92, 28.45]},
                {name: '洛阳', geoCoord: [112.44, 34.7]},
                {name: '秦皇岛', geoCoord: [119.57, 39.95]},
                {name: '株洲', geoCoord: [113.16, 27.83]},
                {name: '石家庄', geoCoord: [114.48, 38.03]},
                {name: '莱芜', geoCoord: [117.67, 36.19]},
                {name: '常德', geoCoord: [111.69, 29.05]},
                {name: '保定', geoCoord: [115.48, 38.85]},
                {name: '湘潭', geoCoord: [112.91, 27.87]},
                {name: '金华', geoCoord: [119.64, 29.12]},
                {name: '岳阳', geoCoord: [113.09, 29.37]},
                {name: '长沙', geoCoord: [113, 28.21]},
                {name: '衢州', geoCoord: [118.88, 28.97]},
                {name: '廊坊', geoCoord: [116.7, 39.53]},
                {name: '菏泽', geoCoord: [115.480656, 35.23375]},
                {name: '合肥', geoCoord: [117.27, 31.86]},
                {name: '武汉', geoCoord: [114.31, 30.52]},
                {name: '大庆', geoCoord: [125.03, 46.58]}
            ]
            var option3 = {
                color: [
                    'rgba(255, 255, 255, 0.8)',
                    'rgba(14, 241, 242, 0.8)',
                    'rgba(37, 140, 249, 0.8)'
                ],
                title: {
                    text: '大规模MarkPoint特效',
                    subtext: '纯属虚构',
                    x: 'center',
                    textStyle: {
                        color: '#fff'
                    }
                },
                legend: {
                    orient: 'vertical',
                    x: 'left',
                    data: ['强', '中', '弱'],
                    textStyle: {
                        color: '#fff'
                    }
                },
                toolbox: {
                    show: true,
                    orient: 'vertical',
                    x: 'right',
                    y: 'center',
                    feature: {
                        mark: {show: true},
                        dataView: {show: true, readOnly: false},
                        restore: {show: true},
                        saveAsImage: {show: true}
                    }
                },
                series: [
                    {
                        name: '弱',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        markPoint: {
                            symbolSize: 2,
                            large: true,
                            effect: {
                                show: true
                            },
                            data: (function () {
                                var data = [];
                                var len = 3000;
                                var geoCoord
                                while (len--) {
                                    geoCoord = placeList[len % placeList.length].geoCoord;
                                    data.push({
                                        name: placeList[len % placeList.length].name + len,
                                        value: 10,
                                        geoCoord: [
                                            geoCoord[0] + Math.random() * 5 - 2.5,
                                            geoCoord[1] + Math.random() * 3 - 1.5
                                        ]
                                    })
                                }
                                return data;
                            })()
                        }
                    },
                    {
                        name: '中',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        markPoint: {
                            symbolSize: 3,
                            large: true,
                            effect: {
                                show: true
                            },
                            data: (function () {
                                var data = [];
                                var len = 1000;
                                var geoCoord
                                while (len--) {
                                    geoCoord = placeList[len % placeList.length].geoCoord;
                                    data.push({
                                        name: placeList[len % placeList.length].name + len,
                                        value: 50,
                                        geoCoord: [
                                            geoCoord[0] + Math.random() * 5 - 2.5,
                                            geoCoord[1] + Math.random() * 3 - 1.5
                                        ]
                                    })
                                }
                                return data;
                            })()
                        }
                    },
                    {
                        name: '强',
                        type: 'map',
                        mapType: 'none',
                        hoverable: false,
                        roam: true,
                        data: [],
                        markPoint: {
                            symbol: 'diamond',
                            symbolSize: 6,
                            large: true,
                            effect: {
                                show: true
                            },
                            data: (function () {
                                var data = [];
                                var len = placeList.length;
                                while (len--) {
                                    data.push({
                                        name: placeList[len].name,
                                        value: 90,
                                        geoCoord: placeList[len].geoCoord
                                    })
                                }
                                return data;
                            })()
                        }
                    }
                ]
            };
            //overlay.setOption(option3);

            var option4 = {
                color: ['gold', 'aqua', 'lime'],
                title: {
                    text: '模拟迁徙',
                    subtext: '数据纯属虚构',
                    x: 'center',
                    textStyle: {
                        color: '#fff'
                    }
                },
                tooltip: {
                    trigger: 'item',
                    formatter: '{b}'
                },
                legend: {
                    orient: 'vertical',
                    x: 'left',
                    data: ['北京', '上海', '广州'],
                    selectedMode: 'single',
                    selected: {
                        '上海': false,
                        '广州': false
                    },
                    textStyle: {
                        color: '#fff'
                    }
                },
                toolbox: {
                    show: true,
                    orient: 'vertical',
                    x: 'right',
                    y: 'center',
                    feature: {
                        mark: {show: true},
                        dataView: {show: true, readOnly: false},
                        restore: {show: true},
                        saveAsImage: {show: true}
                    }
                },
                dataRange: {
                    min: 0,
                    max: 100,
                    calculable: true,
                    color: ['#ff3333', 'orange', 'yellow', 'lime', 'aqua'],
                    textStyle: {
                        color: '#fff'
                    }
                },
                animationDurationUpdate: 2000, // for update animation, like legend selected.
                series: [
                    {
                        name: '北京',
                        type: 'map',
                        roam: true,
                        hoverable: false,
                        mapType: 'none',
                        itemStyle: {
                            normal: {
                                borderColor: 'rgba(100,149,237,1)',
                                borderWidth: 0.5,
                                areaStyle: {
                                    color: '#1b1b1b'
                                }
                            }
                        },
                        data: [],
                        geoCoord: {
                            '上海': [121.4648, 31.2891],
                            '广州': [113.5107, 23.2196],
                            '北京': [116.4551, 40.2539]
                        },
                        markLine: {
                            smooth: true,
                            effect: {
                                show: true,
                                scaleSize: 1,
                                period: 30,
                                color: '#fff',
                                shadowBlur: 10
                            },
                            itemStyle: {
                                normal: {
                                    borderWidth: 1,
                                    label: {
                                        show: false
                                    },
                                    lineStyle: {
                                        type: 'solid',
                                        shadowBlur: 10
                                    }
                                }
                            },
                            data: [
                                [{name: '北京', smoothness: 0.2}, {name: '广州', value: 95}],
                                [{name: '北京', smoothness: 0.3}, {name: '广州', value: 90}],
                                [{name: '北京', smoothness: 0.4}, {name: '广州', value: 80}],
                                [{name: '北京', smoothness: 0.5}, {name: '广州', value: 70}],
                                [{name: '北京', smoothness: 0.6}, {name: '广州', value: 60}],
                                [{name: '广州', smoothness: 0.2}, {name: '北京', value: 50}],
                                [{name: '广州', smoothness: 0.3}, {name: '北京', value: 40}],
                                [{name: '广州', smoothness: 0.4}, {name: '北京', value: 30}],
                                [{name: '广州', smoothness: 0.5}, {name: '北京', value: 20}],
                                [{name: '广州', smoothness: 0.6}, {name: '北京', value: 10}]
                            ]
                        }
                    },
                    {
                        name: '上海',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        markLine: {
                            smooth: true,
                            effect: {
                                show: true,
                                scaleSize: 1,
                                period: 30,
                                color: '#fff',
                                shadowBlur: 10
                            },
                            itemStyle: {
                                normal: {
                                    borderWidth: 1,
                                    label: {
                                        show: false
                                    },
                                    lineStyle: {
                                        type: 'solid',
                                        shadowBlur: 10
                                    }
                                }
                            },
                            data: [
                                [{name: '北京', smoothness: 0.2}, {name: '上海', value: 95}],
                                [{name: '北京', smoothness: 0.3}, {name: '上海', value: 90}],
                                [{name: '北京', smoothness: 0.4}, {name: '上海', value: 80}],
                                [{name: '北京', smoothness: 0.5}, {name: '上海', value: 70}],
                                [{name: '北京', smoothness: 0.6}, {name: '上海', value: 60}],
                                [{name: '上海', smoothness: 0.2}, {name: '北京', value: 50}],
                                [{name: '上海', smoothness: 0.3}, {name: '北京', value: 40}],
                                [{name: '上海', smoothness: 0.4}, {name: '北京', value: 30}],
                                [{name: '上海', smoothness: 0.5}, {name: '北京', value: 20}],
                                [{name: '上海', smoothness: 0.6}, {name: '北京', value: 10}]
                            ]
                        }
                    },
                    {
                        name: '广州',
                        type: 'map',
                        mapType: 'none',
                        data: [],
                        markLine: {
                            smooth: true,
                            effect: {
                                show: true,
                                scaleSize: 1,
                                period: 30,
                                color: '#fff',
                                shadowBlur: 10
                            },
                            itemStyle: {
                                normal: {
                                    borderWidth: 1,
                                    label: {
                                        show: false
                                    },
                                    lineStyle: {
                                        type: 'solid',
                                        shadowBlur: 10
                                    }
                                }
                            },
                            data: [
                                [{name: '上海', smoothness: 0.2}, {name: '广州', value: 95}],
                                [{name: '上海', smoothness: 0.3}, {name: '广州', value: 90}],
                                [{name: '上海', smoothness: 0.4}, {name: '广州', value: 80}],
                                [{name: '上海', smoothness: 0.5}, {name: '广州', value: 70}],
                                [{name: '上海', smoothness: 0.6}, {name: '广州', value: 60}],
                                [{name: '广州', smoothness: 0.2}, {name: '上海', value: 50}],
                                [{name: '广州', smoothness: 0.3}, {name: '上海', value: 40}],
                                [{name: '广州', smoothness: 0.4}, {name: '上海', value: 30}],
                                [{name: '广州', smoothness: 0.5}, {name: '上海', value: 20}],
                                [{name: '广州', smoothness: 0.6}, {name: '上海', value: 10}]
                            ]
                        }
                    }
                ]
            };
            overlay.setOption(option4);


        });
    };
    /**
     * 销毁
     */
    this.destroy = function () {
        gis_layout.removeLeftWidget();
        gis_layout.removeRightWidget();
    };
    /**
     * 模块信息
     * @type {{id: string, name: string}}
     */
    this.title = {
        id: "01_00_00",
        name: "迁徙图"
    };
}

var echartsDemo = null;

function initEchartsDemo() {
    if (echartsDemo == null) {
        echartsDemo = new EchartsDemo();
        echartsDemo.init();
    }
}

/*
 $(function () {
 initEchartsDemo();
 })*/

function text_initEchartsDemo() {
    initEchartsDemo();
}
